package edu.nf.waimai.service.item.impl;

import edu.nf.waimai.dao.item.ItemTypeDAO;
import edu.nf.waimai.dao.item.impl.ItemTypeDAOImpl;
import edu.nf.waimai.model.ltem.ItemType;
import edu.nf.waimai.service.item.ItemService;
import edu.nf.waimai.service.item.ItemTypeService;

import java.util.List;

public class ItemTypeServiceImpl implements ItemTypeService {
    private ItemTypeDAO itemTypeDAO = new ItemTypeDAOImpl();

    /**
     * 添加商品类型业务
     * @param itemType
     * @return
     */
    @Override
    public int addItemType(ItemType itemType) {
        return itemTypeDAO.addItemType(itemType);
    }

    /**
     * 通过id删除商品类型业务
     * @param itemTypeId
     * @return
     */
    @Override
    public int delItemTypeById(int itemTypeId) {
        return itemTypeDAO.delItemTypeById(itemTypeId);
    }

    /**
     * 通过商家id查询全部商品类型
     * @param shopId
     * @return
     */
    @Override
    public List<ItemType> listItemTypesByShopId(int shopId) {
        return itemTypeDAO.listItemTypesByShopId(shopId);
    }


}
